import request from '@/utils/request';
import qs from 'qs'

// 查询用户列表
export function list(data: any) {
	return request({
		url: 'api/sysUser/list'+ '?' + qs.stringify(data, { indices: false }),
    method: 'get',
    data
	});
}

// 新增用户
export function add(data: any) {
	return request({
		url: 'api/sysUser/save',
    method: 'post',
    data
	});
}

// 修改用户
export function edit(data: any) {
	return request({
		url: 'api/sysUser/update',
    method: 'post',
    data
	});
}

// 删除用户
export function del(data: any) {
	return request({
		url: 'api/sysUser/delete',
    method: 'post',
    data
	});
}

// 分配角色
export function role(id:string,data: any) {
	return request({
		url: 'api/sysUser/role/'+id,
    method: 'post',
    data
	});
}

// id查询用户
export function info(id: string) {
  return request({
    url: 'api/sysUser/info/'+id,
    method: 'get'
  })
}

// 超级管理员重置密码
export function repass(id: any) {
  return request({
    url: 'api/sysUser/repass/'+id,
    method: 'post',
  }) 
}
